package cc.comac.mom.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import cc.comac.mom.api.QualityFrrFormService;
import cc.comac.mom.datahandlers.entity.restreceive.QualityFrrFormServiceDataHandler;
import cc.comac.mom.datahandlers.entity.restreceive.QualityQarFrrRelationDataHandler;
import cc.comac.mom.entity.QualityFrrFormEntity;
import cc.comac.mom.entity.QualityQarCheckInvoiceEntity;
import cc.comac.mom.entity.QualityQarFrrRelationEntity;
@RestController
public class QualityFrrFormServiceImpl implements QualityFrrFormService{

	@Autowired
	private QualityFrrFormServiceDataHandler qualityFrrFormServiceDataHandler;
	@Autowired
	private QualityQarFrrRelationDataHandler qualityQarFrrRelationDataHandler;
	@Override
	public String reciveFrrPartData(@RequestBody QualityFrrFormEntity qualityFrrFormEntity) {
		String insertFrrForm = qualityFrrFormServiceDataHandler.insertFrrForm(qualityFrrFormEntity);
		return insertFrrForm;
	}

	@Override
	public String openFrr(@RequestBody QualityQarFrrRelationEntity QualityQarFrrRelationEntity) {
		String openFrr = qualityQarFrrRelationDataHandler.openFrr(QualityQarFrrRelationEntity);
		return openFrr;
	}

	@Override
	public String frrToFileOrScrap(@RequestBody QualityQarFrrRelationEntity QualityQarFrrRelationEntity) {
		String frrToFileOrScrap = qualityQarFrrRelationDataHandler.frrToFileOrScrap(QualityQarFrrRelationEntity);
		return frrToFileOrScrap;
	}
	
	/**
	 * 	当QAR任务需要开立FRR时，QAR系统将该任务信息发送给FRR系统
	 * **/
	@Override
	public String sentQarDataToFrr(@RequestBody QualityQarCheckInvoiceEntity qualityQarCheckInvoiceEntity) {
		String sentQarDataToFrr = qualityQarFrrRelationDataHandler.sentQarDataToFrr(qualityQarCheckInvoiceEntity);
		return sentQarDataToFrr;
	}
	
}
